<!DOCTYPE HTML>
<html>
<head>
    <include file="Common:header_include"/>
    <title>添加医生</title>
    <style>
        #img img{
            float:left;
            width: 200px;
            height: 200px;
            border-radius: 10%;
            margin-left: 10px;

        }
        #layer-photos-demo .images{
            width: 80px;
            height: 80px;
            border-radius: 5px;
        }
    </style>
</head>
<body>
<div class="pd-20">
    <form action="{:U('edit')}" method="post" class="form form-horizontal" id="form">
        <input name="id" value="{$data.id}" hidden="hidden">
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red"></span>头像：</label>
            <div class="formControls col-7">
                <input type="file" class="input-text" name="coverFile" accept="image/*">
            </div>
            <if condition="$data['cover']">
                已上传，<a href="javascript:void(0);" onclick="previewPictures('__UPS__'+'{$data.cover}')" style="color: red;text-decoration: none;">预览</a>
            </if>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red">*</span>所在医院：</label>
            <div class="formControls col-7">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="hospitalid" datatype="*" nullmsg="请选择所在医院">
                    <option value="" selected="" disabled="disabled">请选择</option>
                    <volist name=":getList(Hospitalinfo)" id="v">

                        <option value="{$v.id}"  <if condition="$data['hospitalid'] eq $v['id']">selected</if>>{$v.name}</option>
                    </volist>
                </select>
                </span>
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red">*</span>科室：</label>
            <div class="formControls col-7">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="officeid" datatype="*" nullmsg="请选择科室" onchange="onchangeDepartment($(this))">
                    <option value="" selected="" disabled="disabled">请选择</option>
                    <volist name=":getDepartmentinfoTree()" id="v">
                        <option value="{$v.id}" <if condition="$v['pid'] eq 0">disabled="disabled"</if> <if condition="$data['officeid'] eq $v['id']">selected</if>>{$v.name}</option>
                    </volist>
                </select>
                </span>
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red">*</span>职称：</label>
            <div class="formControls col-7">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="titleid" datatype="*" nullmsg="请选择职称">
                    <option value="" selected="" disabled="disabled">请选择</option>
                    <volist name=":getList(positioninfo)" id="v">
                        <option value="{$v.id}" <if condition="$data['titleid'] eq $v['id']">selected</if>>{$v.name}</option>
                    </volist>
                </select>
                </span>
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red"></span>血型：</label>
            <div class="formControls col-7">
                <span class="select-box">
                <select class="select Validform_error" size="1" name="bloodid" >
                    <option value="" selected="" disabled="disabled">请选择</option>
                    <volist name=":getList(bloodtypeinfo)" id="v">
                        <option value="{$v.id}"  <if condition="$data['bloodid'] eq $v['id']">selected</if>>{$v.name}</option>
                    </volist>
                </select>
                </span>
            </div>
            <div class="col-4"></div>
        </div>
        <!--<div class="row cl" >-->
            <!--<label class="form-label col-1"><span class="c-red"></span>省区：</label>-->
            <!--<div class="formControls col-7">-->
                <!--<span class="select-box">-->
                <!--<select class="select Validform_error" size="1" name="provenceID"  onchange="onchangeProvince($(this))" id="provinceid">-->
                      <!--<option value="" selected="" disabled="disabled">请选择</option>-->
                   <!--<volist name=":getProvinceList(1)" id="v">-->
                        <!--<option value="{$v.aerainfo_id}"   <if condition="$data['provenceid'] eq $v['aerainfo_id']">selected</if>>{$v.aerainfo_name}</option>-->
                    <!--</volist>-->
                <!--</select>-->
                <!--</span>-->
            <!--</div>-->
            <!--<div class="col-4"></div>-->
        <!--</div>-->
        <!--<div class="row cl">-->
            <!--<label class="form-label col-1"><span class="c-red"></span>市区：</label>-->
            <!--<div class="formControls col-7">-->
                <!--<span class="select-box">-->
                <!--<select class="select Validform_error" size="1" name="cityid"  onchange="onchangecity($(this))" id="city">-->
                      <!--<if condition="empty($data.cityid)"><option value="" selected="" disabled="disabled">请选择</option></if>-->
                       <!--<if condition="$data.cityid"><option value="{$data.city.aerainfo_id}" >{$data.city.aerainfo_name}</option></if>-->
                <!--</select>-->
                <!--</span>-->
            <!--</div>-->
            <!--<div class="col-4"></div>-->
        <!--</div>-->
        <!--<div class="row cl" >-->
            <!--<label class="form-label col-1"><span class="c-red"></span>区域：</label>-->
            <!--<div class="formControls col-7">-->
                <!--<span class="select-box">-->
                <!--<select class="select Validform_error" size="1" name="regionid"   id="district">-->
                  <!--<if condition="empty($data.regionid)"><option value="" selected="" disabled="disabled">请选择</option></if>-->
                  <!--<if condition="$data.regionid">   <option value="{$data.region.aerainfo_id}" >{$data.region.aerainfo_name}</option></if>-->
                <!--</select>-->
                <!--</span>-->
            <!--</div>-->
            <!--<div class="col-4"></div>-->
        <!--</div>-->
        <div class="row cl" >
            <label class="form-label col-1">医师资格证：</label>
            <div class="formControls col-7">

                <div id="img">
                    <?php
              $imgs=explode(",",$data['certcover']);
            ?>
                    <div id="layer-photos-demo" class="layer-photos-demo">
                        <volist name="imgs" id="v">
                            <img  class="images"  src="__UPS__{$v}"   layer-index="{$key}">
                        </volist>
                    </div>
                </div>
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red"></span>性别：</label>
            <div class="formControls col-7">
            <span class="select-box">
                <select class="select Validform_error" size="1" name="sex" >
                    <option value="" selected="" disabled="disabled">请选择</option>
                    <option value="1" <if condition="$data['sex'] eq 1">selected</if>>男</option>
                    <option value="0" <if condition="$data['sex'] eq 0">selected</if>>女</option>
                </select>
            </span>
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red"></span>出生日期：</label>
            <div class="formControls col-7">
                <input type="text" class="input-text" placeholder="请输入"   name="birthday" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'});" value="{$data['birthday']}">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red"></span>身份证：</label>
            <div class="formControls col-7">
                <input type="text" class="input-text" placeholder="请输入" name="idcard"  value="{$data['idcard']}">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red">*</span>真实姓名：</label>
            <div class="formControls col-7">
                <input type="text" class="input-text" placeholder="请输入" name="realname" datatype="*" nullmsg="请输入真实姓名" value="{$data['realname']}">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red">*</span>手机号：</label>
            <div class="formControls col-7">
                <input type="text" class="input-text" placeholder="请输入" name="phone" datatype="*" nullmsg="输入手机号"  value="{$data['phone']}">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1"><span class="c-red"></span>住址：</label>
            <div class="formControls col-7">
                <input type="text" class="input-text" placeholder="请输入" name="address"   value="{$data['address']}">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1">邮箱：</label>
            <div class="formControls col-7">
                <input type="text" class="input-text" placeholder="请输入" name="email" value="{$data['email']}">
            </div>
            <div class="col-4"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-1">医生简介：</label>
            <div class="formControls col-7">
                <script id="content" name="remark" type="text/plain" style="width:100%;height:400px;">{:htmlspecialchars_decode($data['remark'])}</script>
                </div>
                <div class="col-4"></div>
     </div>
        <div class="row cl">
            <div class="col-9 col-offset-1">
                <input class="btn btn-primary radius" type="submit" value="提交">
            </div>
        </div>
    </form>
</div>
</div>
<include file="Common:footer_include"/>
<script>
    $(function () {
        var ue = UE.getEditor('content');
    });
//    function onchangeProvince(jqObj){
//        var province_id = jqObj.val();
//        var citycheck = $('#city');
//        citycheck.html('');
//        $.ajax({
//            url: '{:U("Hospitalinfo/getCityListJson")}?province_id=' + province_id,
//            type: 'post',
//            enctype: 'multipart/form-data',
//            success: function (data) {
//                $.each(data, function (i, item) {
//                    citycheck.append('<option value="' + item.aerainfo_id + '" >' + item.aerainfo_name + '</option>');
////                    var diseaseHtml="<div class='skin-minimal check-box' style='width: 200px;margin-top: 5px'> <div class='check-box'> <input type='checkbox' name='disease_id[]' checked value='"+item.id+"'>"+item.title+"</div> </div>";
////                    diseaseBox.append(diseaseHtml);
//                });
//                onchangecity(citycheck);
//            }
//        });
//
//    }
//    function onchangecity(jqObj){
//        var city_id = jqObj.val();
//        var districtcheck = $('#district');
//        var ajaxurl='{:U("Hospitalinfo/getDistrictJson")}?city_id=' + city_id;
//        districtcheck.html('');
//        $.ajax({
//            url:ajaxurl ,
//            type: 'post',
//            enctype: 'multipart/form-data',
//            success: function (data) {
//                $.each(data, function (i, items) {
//                    districtcheck.append('<option value="'+ items.aerainfo_id + '" >'+ items.aerainfo_name + '</option>');
//                });
//            }
//        });
//    }
        layer.photos({
            photos: '#layer-photos-demo',
            tab: function(pic, layero){
                console.log(pic) //当前图片的一些信息
            }
        });
</script>
</body>
</html>